import datetime
import os

class DateTimeUtils:
    @staticmethod
    def format_date(date_obj, format_str="%Y-%m-%d %H:%M:%S"):
        """格式化日期为指定格式字符串"""
        if not isinstance(date_obj, datetime.date):
            raise InvalidParameterException("Invalid date object provided.")
        return date_obj.strftime(format_str)

    @staticmethod
    def get_current_timestamp():
        """获取当前时间戳"""
        return datetime.datetime.now().timestamp()

if __name__ == '__main__':
    print(datetime.datetime.now())
    print(DateTimeUtils.format_date(datetime.datetime.now()))